package com.yh.patterns.factory.factory_method;


/**
 * @Auther:云尚学Java
 * 咖啡店类
 */
public class CoffeeStore {
    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }
    //1.点咖啡功能
    public Coffee orderCoffee(){
      Coffee coffee = factory.createCoffee();
      //2.加配料
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
